<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="CSS/style.css" rel="stylesheet" type="text/css" />
        <LINK REL="SHORTCUT ICON" HREF="image/favicon.ico"/>
        <title>KuraKura</title>
        <script type="text/javascript">
            function getXmlHttpRequest() {
                var xmlHttpObj;
                if (window.XMLHttpRequest)
                {
                    xmlHttpObj = new XMLHttpRequest( );
                }
                else
                {
                    xmlHttpObj = new ActiveXObject("Microsoft.XMLHTTP");
                }
                return xmlHttpObj;
            }

            function Ambil(File,Level){
                xmlhttp=getXmlHttpRequest();

                xmlhttp.onreadystatechange=function()
                {
                    if (xmlhttp.readyState==4 && xmlhttp.status==200)
                    {
                        document.getElementById(File).innerHTML=xmlhttp.responseText;
                        setTimeout("Perlihatkan()",30000);
                    }
                }
                xmlhttp.open("GET","ambildir.php?file="+File+"&&num="+Level,true);
                xmlhttp.send(null);
            }

            function Perlihatkan(){
                xmlhttp=getXmlHttpRequest();

                xmlhttp.onreadystatechange=function()
                {
                    if (xmlhttp.readyState==4 && xmlhttp.status==200)
                    {
                        document.getElementById("list").innerHTML=xmlhttp.responseText;
                        setTimeout("Perlihatkan()",5000);
                    }
                }
                xmlhttp.open("GET","ambilfile.php",true);
                xmlhttp.send(null);
            }
        </script>
    </head>
    <body>
        <div id="heading">
            <div id="link"><a href="logout.php"><b>Logout</b></a></div>
            <img src="image/KuraKuraHead.png" alt="image tidak bisa ditampilkan" height="200px"/>
        </div>
        <div id="isi">
            <div id="gede">
                File Anda, <?php echo($_SESSION['username']);?>
            </div>
            <br/><br/>
            <div id="list">
                <script type="text/javascript">Perlihatkan()</script>
            </div>
        </div>
        <?php

        ?>
    </body>
</html>
